<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
//短信日志表
class Sms_model extends CI_Model{
    function __construct() {
        parent::__construct();
        $this->table = 'sms_content';
    }
    
    function getCount($where){
        $this->db->select('*');
        $this->db->from($this->table);
        $this->db->where($where);
        $this->db->order_by("create_time", "desc");
        $query = $this->db->get();
        return $query->num_rows();
    }
    
    function getList($where,$page,$limit){
        $this->db->select($this->table.'.*');
        $this->db->from($this->table);
        $this->db->where($where);
        $this->db->order_by("create_time", "desc");
        $this->db->limit($limit, $page);
        $query = $this->db->get();
        return $query->result_array(); 
    }

    //删除数据
    function delete($delid)
    {	
            $this->db->where('id',$delid);
            $this->db->delete($this->table);
            return $this->db->affected_rows();
    }
}
